namespace iTunesExport.Parser
{
    /// <summary>
    /// Represents an individual playlist from the iTunes library.
    /// </summary>
    public class Playlist
    {                      
        private readonly char[] illegalCharacters = System.IO.Path.GetInvalidFileNameChars();

        public Playlist( string id, string name, bool folder, Track[] tracks )
        {
            Id = id;
            Name = name;
            Folder = folder;
            foreach (char illegalChar in illegalCharacters)
                Name = name.Replace(illegalChar, '-');            
            Tracks = tracks;
        }

        /// <summary>
        /// The unique ID for this playlist.
        /// </summary>
        public string Id { get; private set; }

        /// <summary>
        /// The display name for this playlist.
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// Indicates whether this playlist is based on a folder in iTunes.
        /// </summary>
        public bool Folder { get; private set; }
       
        /// <summary>
        /// An array of the Tracks that appear within this playlist.
        /// </summary>
        public Track[] Tracks { get; private set; }        
    }
}
